#include <iostream>
#include <cstring>

using namespace std;

int main(void)
{
	char str[100];
        int i = 0;

        cout << "string: ";
        do
        {
                scanf("%c", &str[i]);
                i ++;
        }
        while(str[i - 1] != '#');
        str[i - 1] = '\0';

        int l = strlen(str);
        int sum1 = 0;
	int sum2 = 0;

	for(i = 0; i < l; i ++)
	{
		if(str[i] == '(')
			sum1 ++;
		if(str[i] == ')')
			sum2 ++;	
	}

	if(sum1 == sum2)
		cout << "True" << endl;
	else
		cout << "False" << endl;

	return 0;
}
